//
//  echoall.c
//  5-5
//
//  Created by Kai Wang on 5/16/14.
//  Copyright (c) 2014 ISCAS. All rights reserved.
//

#include <stdio.h>
#include <unistd.h>

int
main(int argc, char *argv[])
{
	int			i;
	char		**ptr;
	extern char	**environ;
    
	for (i = 0; i < argc; i++)		/* echo all command-line args */
		printf("argv[%d]: %s\n", i, argv[i]);
    
	for (ptr = environ; *ptr != 0; ptr++)	/* and all env strings */
		printf("%s\n", *ptr);
    
	exit(0);
}
